<template>
<!-- 评价 评价列表中使用 -->
  <div class="comment">
    <div class="line_1">
      <div class="userInfo">
        <img class="headerImg" :src="commentObj.headImage" />
        <div class="user">
          <div class="nickName">{{commentObj.userName}}</div>
          <Star :score="commentObj.score" />
        </div>
      </div>
      <div class="date">{{commentObj.creationTime | creationTimeFormat}}</div>
    </div>
    <div class="commentDetail">
      <div class="line_2">{{commentObj.content}}</div>
      <div class="line_3">
        <img 
          v-for="item in commentObj.images" 
          :key="item.id" 
          :src="item.small" 
          :class="[commentObj.images.length === 1 ? 'img_one' : '']"
        />
      </div>
      <div class="line_4">
        <div class="skuAttrs">{{commentObj.skuAttrs}}</div>
        <div class="likes">
          <img src="../../../../static/images/icon_laud_black.png" />
          <div>{{commentObj.likes}}</div>
        </div>
      </div>
      <div class="replies">
        <div class="item" v-for="item in commentObj.replies" :key="item.replyId">
          <img class="headImg" :src="item.headImage" />
          <div class="replyContent"><span>{{item.replyerName}}：</span>{{item.replyContent}}</div>
          <div class="likes">
            <img src="../../../../static/images/icon_laud_black.png" />
            <div>赞客服 {{item.likes}}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Star from './star'
export default {
  name: 'comment',
  props: {
    commentObj: Object, // 单个评价
  },
  components: {
    Star
  },
  data () {
    return {

    }
  },
  methods: {

  },
  mounted() {
 
  }
}
</script>

<style scoped lang="scss">
.comment{
  padding: 30px 32px 10px 32px;
  border-bottom: 16px solid #f9f9f9;
  text-align: left;
  background-color: white;
  .line_1{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: nowrap;
    font-size: 24px;
    text-align: left;
    .userInfo{
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      flex-wrap: nowrap;
      .headerImg{
        width: 62px;
        height: 62px;
        border-radius: 50%;
        margin-right: 16px;
      }
      .user{
        .nickName{
          color: #333;
          margin: 6px 0;
        }
      }
    }
    .date{
      color: #999;
      line-height: 62px;
    }
  }
  .commentDetail{
    padding: 30px 30px 0 30px;
    .line_2{
      word-break: break-all;
      color: #333;
      font-size: 26px;
      text-align: left;
      padding-bottom: 20px;
    }
    .line_3{
      text-align: left;
      margin-bottom: 30px;
      img{
        width: 188px;
        height: 188px;
        margin-right: 10px;
      }
      .img_one{
        width: 406px;
        height: 406px;
      }
    }
    .line_4{
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      flex-wrap: nowrap;
      color: #999;
      font-size: 24px;
      border-bottom: 1px solid #eee;
      padding-bottom: 14px;
      margin-bottom: 25px;
      .likes{
        height: 50px;
        line-height: 50px;
        padding-left: 50px;
        color: #333;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        flex-wrap: nowrap;
        img{
          width: 50px;
          height: 50px;
        }
      }
    }
    .replies{
      padding: 10px 0;
      .item{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: nowrap;
        font-size: 24px;
        margin-bottom: 12px;
        position: relative;
        padding-bottom: 40px;
        .headImg{
          width: 40px;
          height: 40px;
          border-radius: 50%;
          margin-right: 8px;
        }
        .replyContent{
          color: #333;
          word-break: break-all;
          line-height: 1.4;
          span{
            color: #ca151e;
          }
        }
        .likes{
          position: absolute;
          right: 0;
          bottom: 0;
          margin-top: 20px;
          height: 32px;
          line-height: 32px;
          padding-left: 32px;
          color: #333;
          display: flex;
          flex-direction: row;
          justify-content: flex-end;
          flex-wrap: nowrap;
          img{
            width: 32px;
            height: 32px;
          }
        }
      }
    }
  }
}
</style>

